package com.qiyu.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * mybatis-plus增强工具
 */
@Component
public class MybatisPlusHandler implements MetaObjectHandler {
    
    @Override
    public void insertFill(MetaObject metaObject) {
        // 插入数据时自动填充
        this.setFieldValByName("createTime", new Date(), metaObject);
    }
    
    @Override
    public void updateFill(MetaObject metaObject) {
    
    }
}
